package com.app.bo.webcontent;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.app.entity.MenuOption;
import com.app.jpa.webcontent.WebContentService;
import com.app.to.Menu;

@Component("WebContentBO")
public class WebContentBO {

	@Autowired
	private WebContentService contentService;

	public List<Menu> getListMenuOption() {
		List<MenuOption> menuOption = contentService.getListMenuOption();
		Menu menu = null;
		List<Menu> menuList = new ArrayList<Menu>();
		if (menuOption != null && menuOption.size() > 0) {
			for (MenuOption m : menuOption) {
				menu = new Menu();
				menu.setDescripcion(m.getDescripcion());
				menuList.add(menu);
			}

		}
		return menuList;

	}
}
